import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CalibrateVO, CalibrateForm, CalibrateQuery } from '@/api/zntx-app/calibrate/types';

/**
 * 查询标定点管理列表
 * @param query
 * @returns {*}
 */

export const listCalibrate = (query?: CalibrateQuery): AxiosPromise<CalibrateVO[]> => {
  return request({
    url: '/zntx-app/calibrate/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询标定点管理详细
 * @param id
 */
export const getCalibrate = (id: string | number): AxiosPromise<CalibrateVO> => {
  return request({
    url: '/zntx-app/calibrate/' + id,
    method: 'get'
  });
};

/**
 * 新增标定点管理
 * @param data
 */
export const addCalibrate = (data: CalibrateForm) => {
  return request({
    url: '/zntx-app/calibrate',
    method: 'post',
    data: data
  });
};

/**
 * 修改标定点管理
 * @param data
 */
export const updateCalibrate = (data: CalibrateForm) => {
  return request({
    url: '/zntx-app/calibrate',
    method: 'put',
    data: data
  });
};

/**
 * 删除标定点管理
 * @param id
 */
export const delCalibrate = (id: string | number | Array<string | number>) => {
  return request({
    url: '/zntx-app/calibrate/' + id,
    method: 'delete'
  });
};
